<script>
import * as echarts from 'echarts';
import {queryScoreTrend} from "@/api/teaching/examrecord"
import hasRole from "@/directive/permission/hasRole";
import store from "@/store";
export default {
  name: "DailyTask",
  props: {
  },
  data() {
    return {

    }
  },
  mounted() {
    if(!this.$auth.hasRoleAndExcludeSuper('student'))
    {
      return;
    }
    var chartDom = document.getElementById('ScoreTrend');
    var myChart = echarts.init(chartDom);
    var option;
    queryScoreTrend().then(resp=>{
      option = {
        xAxis: {
          type: 'category',
          data: resp.data.stageWeekList
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: resp.data.stageWeekScoreList,
            type: 'line'
          }
        ]
      };

      option && myChart.setOption(option);
    })

  }
};


</script>

<template>
    <div id="ScoreTrend" style="width: 100%;height:400px;align-content: center" ></div>
</template>

<style scoped lang="scss">

</style>
